# encoding: utf-8
# @File  : test04.py
# @Author: wu shaofan
# @Date  :  2024/06/19
# @Desc :
import time
from selenium.webdriver.common.by import By
from TPshop_webdemo_pro.Utils.get_driver import GetDriver


# def study(para):
#     try:
#         if para == 1:
#             assert 1 == 1
#             print("测试通过")
#         else:
#             print("测试不通过")
#             assert 1 == 2
#     except AssertionError as e:
#         time.sleep(3)
#         print("测试失败")

def study():
    url = "https://www.baidu.com"
    driver = GetDriver().get_driver(url)

    try:
        driver.find_element(By.ID, "kw1").send_keys("selenium")
        driver.find_element(By.ID, "su").click()

    except Exception as e:
        print(111)
        driver.find_element(By.ID, "kw").send_keys("selenium")
        driver.find_element(By.ID, "su").click()
        time.sleep(2)


study()
